refactor
kinda working now.