making things static, adding comments and removing unneeded code