changing effects to dictionaries, fixing lambda to pass correct code parameter to each function