removed cruft, cleaned up code