source formatting and some irrelevant methods removed
changed signature to be more user friendly