Added comments. Made prettier