Addded basic functionality and tests