Based on ScaleRaphael by Zevan Rosser 2010