Feature/fix order of operations