reduced redundancy in code
deleted old prog