done porting over pipeline stage placement code