cleaned it up, fixed bugs