final working Version 1