updates functions for levels