Add some mor code

If-else part must be changed