Cleaned up crap code