cleaning code and adding some documentation