cleaned up tux's code