Written and tested using UnityEngine