Finished functionality. Need to comment and clean.