cleaning code, adding comments etc