updated layout, added many test cases