Removed unused fields, and changed implementation to use the width and height parameters