Cleaning up and adding some simple functionality