refactored using custom objects
Got working unit dimensions