fix indentation
move to top scope to avoid upvaluing functions