diff --git a/Core/Algorithms/src/DetectorMask.cpp b/Core/Algorithms/src/DetectorMask.cpp
index 759ad820f7d5abcb4fe0dd2c4c4ceb7b374d5ce9..9eca230aff6a726f689cd226b602d8c72202389a 100644
--- a/Core/Algorithms/src/DetectorMask.cpp
+++ b/Core/Algorithms/src/DetectorMask.cpp
@@ -20,8 +20,6 @@
 
 
 // InfinitePlane, Line, VerticalLine, HorizontalLine, Ellipse, Rectangle
-//
-// Polygon stdvector<stdvector<double>> constructor
 
 DetectorMask::DetectorMask()
 {
@@ -42,7 +40,6 @@ DetectorMask &DetectorMask::operator=(const DetectorMask &other)
         tmp.swapContent(*this);
     }
     return *this;
-
 }
 
 void DetectorMask::addMask(const Geometry::IShape2D &shape, bool mask_value)
diff --git a/Core/Geometry/inc/Rectangle.h b/Core/Geometry/inc/Rectangle.h
new file mode 100644
index 0000000000000000000000000000000000000000..11df82c591ea05af3be566626aed7c1e812a7e51
--- /dev/null
+++ b/Core/Geometry/inc/Rectangle.h
@@ -0,0 +1,55 @@
+// ************************************************************************** //
+//
+//  BornAgain: simulate and fit scattering at grazing incidence
+//
+//! @file      Geometry/inc/Rectangle.h
+//! @brief     Defines class Rectangle.
+//!
+//! @homepage  http://www.bornagainproject.org
+//! @license   GNU General Public License v3 or higher (see COPYING)
+//! @copyright Forschungszentrum Jülich GmbH 2015
+//! @authors   Scientific Computing Group at MLZ Garching
+//! @authors   C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
+//
+// ************************************************************************** //
+
+#ifndef RECTANGLE_H
+#define RECTANGLE_H
+
+#include "IShape2D.h"
+
+namespace Geometry {
+
+
+//! @class Rectangle
+//! @ingroup tools
+//! @brief The non-rotatable rectangle.
+
+class  Rectangle : public IShape2D {
+public:
+    //! Rectangle constructor with lower left and upper right coordinates
+    //! @param xlow x-coordinate of lower left corner
+    //! @param ylow y-coordinate of lower left corner
+    //! @param xup x-coordinate of upper right corner
+    //! @param yup y-coordinate of upper right corner
+    Rectangle(double xlow, double ylow, double xup, double yup);
+
+    Rectangle *clone() const;
+
+    //! Returns true if given point is inside or on border of polygon
+    bool contains(double x, double y) const;
+
+    //! Returns true if area defined by two bins is inside or on border of polygon.
+    //! More precisely, if mid point of two bins satisfy this condition.
+    bool contains(const Bin1D &binx, const Bin1D &biny) const;
+
+    double getArea() const;
+
+private:
+    Rectangle(const Rectangle& other);
+    double m_xlow, m_ylow, m_xup, m_yup;
+};
+
+} // namespace Geometry
+
+#endif
diff --git a/Core/Geometry/src/Rectangle.cpp b/Core/Geometry/src/Rectangle.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fe42567bf995bc73859c7607cf38d28e97257754
--- /dev/null
+++ b/Core/Geometry/src/Rectangle.cpp
@@ -0,0 +1,71 @@
+// ************************************************************************** //
+//
+//  BornAgain: simulate and fit scattering at grazing incidence
+//
+//! @file      Geometry/src/Rectangle.cpp
+//! @brief     Implements class Rectangle.
+//!
+//! @homepage  http://www.bornagainproject.org
+//! @license   GNU General Public License v3 or higher (see COPYING)
+//! @copyright Forschungszentrum Jülich GmbH 2015
+//! @authors   Scientific Computing Group at MLZ Garching
+//! @authors   C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
+//
+// ************************************************************************** //
+
+#include "Rectangle.h"
+#include "Bin.h"
+
+namespace Geometry {
+
+Rectangle::Rectangle(double xlow, double ylow, double xup, double yup)
+{
+    if(xup <= xlow) {
+        std::ostringstream message;
+        message << "Rectangle(double xlow, double ylow, double xup, double yup) -> Error. ";
+        message << " xup <= xlow" << std::endl;
+        throw LogicErrorException(message.str());
+    }
+    if(yup <= ylow) {
+        std::ostringstream message;
+        message << "Rectangle(double xlow, double ylow, double xup, double yup) -> Error. ";
+        message << " yup <= ylow" << std::endl;
+        throw LogicErrorException(message.str());
+    }
+    m_xlow = xlow;
+    m_ylow = ylow;
+    m_xup = xup;
+    m_yup = yup;
+}
+
+Rectangle *Rectangle::clone() const
+{
+    return new Rectangle(*this);
+}
+
+bool Rectangle::contains(double x, double y) const
+{
+    if(x <= m_xup && x >= m_xlow && y <= m_yup && y >= m_ylow) return true;
+    return false;
+}
+
+bool Rectangle::contains(const Bin1D &binx, const Bin1D &biny) const
+{
+    return contains(binx.getMidPoint(), biny.getMidPoint());
+}
+
+double Rectangle::getArea() const
+{
+    return (m_xup-m_xlow)*(m_yup-m_ylow);
+}
+
+Rectangle::Rectangle(const Rectangle &other)
+    : m_xlow(other.m_xlow)
+    , m_ylow(other.m_ylow)
+    , m_xup(other.m_xup)
+    , m_yup(other.m_yup)
+{
+
+}
+
+} // namespace Geometry
diff --git a/Tests/UnitTests/TestCore/Shape2DTest.h b/Tests/UnitTests/TestCore/Shape2DTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..1548ae50a70138b48e2c2a4b85e716088b14d764
--- /dev/null
+++ b/Tests/UnitTests/TestCore/Shape2DTest.h
@@ -0,0 +1,48 @@
+#ifndef SHAPE2DTEST_H
+#define SHAPE2DTEST_H
+
+#include "Rectangle.h"
+#include "gtest/gtest.h"
+#include <boost/scoped_ptr.hpp>
+#include <boost/assign/list_of.hpp>
+
+class Shape2DTest : public ::testing::Test
+{
+public:
+};
+
+
+TEST_F(Shape2DTest, Rectangle)
+{
+    Geometry::Rectangle rect(-4.0, -2.0, 4.0, 2.0);
+    EXPECT_DOUBLE_EQ(32.0, rect.getArea());
+    EXPECT_TRUE(rect.contains(0.0, 0.0));
+    EXPECT_TRUE(rect.contains(4.0, 2.0));
+    EXPECT_TRUE(rect.contains(-4.0, -2.0));
+    EXPECT_TRUE(rect.contains(-4.0, -2.0));
+    EXPECT_FALSE(rect.contains(0.0, 2.01));
+    EXPECT_FALSE(rect.contains(4.0, -2.01));
+
+    Bin1D binx1(3.5, 4.5);
+    Bin1D biny1(1.5, 2.5);
+    EXPECT_TRUE(rect.contains(binx1, biny1));
+
+    Bin1D binx2(3.5, 4.6);
+    Bin1D biny2(1.5, 2.6);
+    EXPECT_FALSE(rect.contains(binx2, biny2));
+
+    boost::scoped_ptr<Geometry::Rectangle> clone(rect.clone());
+    EXPECT_DOUBLE_EQ(32.0, clone->getArea());
+    EXPECT_TRUE(clone->contains(0.0, 0.0));
+    EXPECT_TRUE(clone->contains(4.0, 2.0));
+    EXPECT_TRUE(clone->contains(-4.0, -2.0));
+    EXPECT_TRUE(clone->contains(-4.0, -2.0));
+    EXPECT_FALSE(clone->contains(0.0, 2.01));
+    EXPECT_FALSE(clone->contains(4.0, -2.01));
+    EXPECT_TRUE(clone->contains(binx1, biny1));
+    EXPECT_FALSE(clone->contains(binx2, biny2));
+}
+
+
+
+#endif
diff --git a/Tests/UnitTests/TestCore/main.cpp b/Tests/UnitTests/TestCore/main.cpp
index 98a456f7af9d2767d39211badcd47ef328a6f141..f23fbe0f9d8a26a6f153967968e8cbfcfbe69255 100644
--- a/Tests/UnitTests/TestCore/main.cpp
+++ b/Tests/UnitTests/TestCore/main.cpp
@@ -55,6 +55,7 @@
 #include "Histogram2DTest.h"
 #include "PolygonTest.h"
 #include "DetectorMaskTest.h"
+#include "Shape2DTest.h"