removed huge debugging function