I made a widget a while back that was supposed to take a few weeks but I managed to complete it in a few days. My client was wildly suspicious of me even going to the extent of asking if I had copied the code for it LOL.But I didnt the truth is I used the pomodoro technique,its a way of time management.You basically work for 25 min and take 5 minutes breaks,after you do this 4 times then you take a longer break.This has worked wonders for my productivity and you should try it whenever you need to focus on a task.