added code for miscellaneous of phase 3
merged conflicts