code restructure take two

faweijpofawe