Several improvements

I’ve just found out fresh info at stackoverflow and added new lines of
code