Added comments and stuff cleaned up