remerged some code