finally works in both ways

also, fix indentation