commented on the code + cleaned it