Added mask drawing functionality