Cleaned up code for end of line version