full working version