Don't judge the code :) as it is for demostration purposes only. You can check the source code  here