resolved confilcts and minor code changes