cleaned code to follow convention better for merging