merged with changes by kelvin