Added removing and optional replacing of cubes