Tidying up

Old code ripped out, added comments