added boilerplate, cleaned up code