added rotation. converted editor to a prototype