fixed bugs, improved layout