Fixed mistakes. Fixed layout. Finalized code