Moved functions into separate file.
Started implementing GUI