restarted from scratch, old code was ugly and confusing. KISS principle <3