cleaned up crap code