Added tests and slightly updated code for convenience
added idea project files