finalized basic layout and fixed some bugs