removed debug and obsolete code