Commited #47 after modification of bugs.