segfault on start fixed, new rotation logic