Finished pset

Rewrote some functions with pattern matching. Finished round10  and
rotate