i wrote measurements function