Changed around some functions