Re-added test cases and added citations to code