Added generic typing to solution