changed to rotate and scale around (0,0) and added error handling for missing attributes