lots of changes to get this bastard working with pycam.