Code cleanup, fixed rotation more