changed all functions