finished rotate method in ps8/hw8a/