Finished rotating and storage stuff

also fixed a memory issue
added a warning pragma
a few other small fixes