install popwin and some tidy up