implement rotate and rotated functions, closes #43, needs to be tested on raspberry pi