Basic functionality implemented. Need to debug.