formatting and removal of unneeded code