fixed rotation bug, introduced a nice memory leak