Changed to use updated code as base