Removes unnecessary code
TODO: program copy and paste via the method rather than two different
approaches, and determine how to implement selection