Finished a complete working version