updated function definitions (cleaner)