Added most of the basic functionality