Cleaned up finished code