construct_im working... the top_k algorithm has to be rewritten, not working properly