merging code from donya and me