cleaned up and rebuilt to minimize code