Fixed bugs. 

Application almost complete