refactor and adjust layout
update to homework version