Minor changes to working version