Finished up the main features of the code.