Routines

http://pastebin.com/hWkzFeTB