adding main sort of broke it
merged my version and Emil's