finalized layout ui functionality