changed function names to be relevant to its job