Cleaned up code by a lot. Removed all the unnecessary sample stuff.