Implementation finished. Now correcting minor bugs.