rectangle method simplified to reduce time