First real checkin
lots of fixes
Adding in DCJ's changes