cleaned up with comments