major code overhaul... it's better code now though...