finished program and updated tests. also, put the class into its own file