Adding initial code modifications. More needed!