Added functionality

Added the core functionality. Need to finish.