Modified slightly for ease of use and speed