fixed clusterfuck of code this afternoon