updated with fixes #6