fixed some issues with declaring values of variables equal to return value of a function