Added initial working version with test