code changed to fit style guide, custom machers added and some minor changes made