cleaned up/commented code