partial preproject code