updated formatting, cleaned up cocoa functions
document, clean up