added tray modules
removed newline
prettified comments
added comments and renamed functions